<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%><%@ include file="/include.inc.jsp"%>
<style type="text/css">
	th,td{
		text-align:left;
	}
	.image-upload {
	    left: 0;
	    opacity: 0;
	    position: absolute;
	    top: 0;
	    width:100%;
	}
</style>
<script type="text/javascript">
	$("#form1").ajaxForm({
		dataType:"json",
		success:function(data){
			if(data.status == "success"){
				$("#img").val(data.msg);
				$("#showImg").val(data.msg);
			}else{
				alert(data.msg);
			}
		},
		error:function(){
			alert("上传图片异常...");
		}
	});
	
	//图片上传
	function doUploadFile(){
		$("#form1").submit();
	}
</script>
<div class="bjui-pageContent">
<form method="post" action="${path}/sysBootScreen/doAdd" class="pageForm"  data-toggle="validate" data-reload-navtab="true">
	<input id="id" name="sysBootScreen.id" value="${sysBootScreen.id}" type="hidden"/>
	<input id="img" type="hidden" name="sysBootScreen.img_url" value="${sysBootScreen.img_url}">
	<div class="pageFormContent" data-layout-h="0">
	    <div class="suggestion">
            <span class="sugicon"><span class="strong colorgorning2">当前操作提示：</span><span class="colorgorningage">请在以下窗口中输入广告图信息</span></span>
        </div>
        <table class="table table-condensed table-hover" data-width="100%">
	    	<tbody>
	        	<tr>
	            	<td><label for="j_role_add_name" class="control-label x85">标题</label>
	                	<input type="text" data-rule="required" class="required" name="sysBootScreen.title" value="${sysBootScreen.title}">
	                </td>
	            </tr>
	            <tr>
	            	<td><label for="j_role_add_name" class="control-label x85">链接</label>
	                	<input type="text" data-rule="required" class="required" name="sysBootScreen.jump_url" value="${sysBootScreen.jump_url}">
	                </td>
	            </tr>   
	            <tr>
	            	<td><label for="j_role_add_name" class="control-label x85">排序</label>
	                	<input type="text" data-rule="required" class="required" name="sysBootScreen.show_number" value="${sysBootScreen.show_number}">
	                </td>
	            </tr>
	            <tr>
	            	<td><label for="j_role_add_name" class="control-label x85">发布</label>
	                	<input type="radio" name="sysBootScreen.is_release" data-toggle="icheck" value="1" <c:if test="${sysBootScreen.is_release == 1}"> checked="checked" </c:if> data-rule="checked" data-label="是&nbsp;&nbsp;">
	                	<input type="radio" name="sysBootScreen.is_release" data-toggle="icheck" value="0" <c:if test="${sysBootScreen.is_release == 0}"> checked="checked" </c:if> data-label="否">
	                </td>
	            </tr>
	        </tbody>
        </table>
	</div>
	<div class="bjui-footBar" style="text-align: center;">
		<ul style="margin-left: 40%">
			<li style="float: left"><div class="buttonActive"><div class="buttonContent"><button  type="submit" class="btn-default" data-icon="save" >确认保存</button></div></div></li>
			<li style="float: left"><div class="button"><div class="buttonContent"><button type="button" class="btn-close" data-icon="close" >取消保存</button></div></div></li>
		</ul>
	</div>
</form>
</div>

<div class="bjui-pageContent" style="position:absolute;left:0;top:136px;">
<form id="form1" action="${path}/fileUpload" method="post" enctype="multipart/form-data" class="pageForm">
	<div class="pageFormContent" data-layout-h="0">
        <table class="table table-condensed table-hover" data-width="100%">
	    	<tbody>
	            <tr>
	            	<td><label for="j_role_add_name" class="control-label x85">图片</label>
	                	<input id="showImg" type="text" readonly="readonly" value="${sysBootScreen.img_url}">
	                	<a href="javascript:void(0);" class="btn btn-green">上传
							<input id="file" name="file" type="file" class="image-upload" onchange="doUploadFile();"/>
						</a>
	                </td>
	            </tr>
	        </tbody>
        </table>
	</div>
</form>
</div>
